<?php
session_start();

//Idioma por Default
if(!isset($_SESSION['Idioma']) || !empty($_REQUEST['selLanguage'])) {
	if(!empty($_REQUEST['selLanguage']))
		$_SESSION['Idioma'] = $_REQUEST['selLanguage'];
	else
		$_SESSION['Idioma'] = 'es';
}

require("includes/selectLanguage.php");
require("includes/constants.php");

if($_SESSION['Idioma'] == 'es') {
	$imgES = 'es.png';
	$imgEN = 'en_off.png';
	$slanguage = 'es';
}
else if ($_SESSION['Idioma'] == 'en') {
	$imgES = 'es_off.png';
	$imgEN = 'en.png';
	$slanguage = 'en';
}

?>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title><?=$a_languages["Common.LARCTEST"];?></title>
		<style type="text/css" title="currentStyle">
			@import "css/css.css";
		</style>
		<!-- Javascript -->
        <script type="text/javascript" src="js/jquery/jquery-1.7.1.min.js"></script>
        <script type="text/javascript" src="js/jquery/jquery-ui-1.8.16.custom.min.js"></script>
		<script type="text/javascript" src="js/easySlider1.7.js"></script>
		<script type="text/javascript">
			$(document).ready(function(){	
				$("#slider").easySlider({
					auto: true, 
					continuous: true
				});
			});	
		</script>
		
		<!-- JS Login -->
		<script type="text/javascript" src="js/utils.js"></script>
		<script type="text/javascript" src="js/login.js"></script>
	</head>
	
	<body>
		<div class="principal">
        	<div id="slider">
 				<ul>
 					<li><img src="images/carrera.jpg" /></li>
            		<li><img src="images/equi.jpg" /></li>
            		<li><img src="images/polo.jpg" /></li>
 				</ul>
 			</div>
		</div>
		
      	<div class="contenedora">
      		<div id="lang" style="margin-top: 3px;">
				<form id="frmWebPage" method="post" action="">
					<input type="hidden" id="selLanguage" name="selLanguage" value="<?=$slanguage?>" />
					<a href="javascript:;" onclick="$_changeLanguage('es')" style="margin-left:5px;"><img src="images/language/<?=$imgES?>" border="none" /></a>
					<a href="javascript:;" onclick="$_changeLanguage('en')" style="margin-left:5px;"><img src="images/language/<?=$imgEN?>" border="none" /></a>
				</form>
			</div>
			
          <?php include_once('layout/headerHome.php');?>
          <div class="clear"></div>  
          <?php include_once('layout/sidebar.php');?>  	
          <div class="clear"></div>          
                
			<div class="main">
			<?php
				switch ($_REQUEST['screen']) {
					case 'login':
						include_once('layout/sections/login.php');
						break;
					case 'consult':
						include_once('layout/sections/consult.php');
						break;
					case 'faq':
						include_once('layout/sections/faq.php');
						break;
					case 'technicalBase':
						include_once('layout/sections/technicalBase.php');
						break;
					case 'training':
						include_once('layout/sections/training.php');
						break;
					case 'whatis':
						include_once('layout/sections/whatis.php');
						break;
					case 'whytodo':
						include_once('layout/sections/whytodo.php');
						break;
					case 'howtodo':
						include_once('layout/sections/howtodo.php');
						break;
					case 'polo':
						include_once('layout/sections/polo.php');
						break;
					case 'turf':
						include_once('layout/sections/turf.php');
						break;
					case 'endurance':
						include_once('layout/sections/endurance.php');
						break;
					default:
						include_once('layout/sections/whatis.php');
						break;
				}
			?>
			</div>
			<div class="clear"></div>
       </div>
       <?php include_once('layout/footer.php');?>
	</body>
</html>
